//
//  NSDate+Interval.h
//  日期处理
//  TryShoppingHD
//
//  Created by Mr.Lee on 16/7/14.
//  Copyright © 2016年 Reabam. All rights reserved.
//

#import <Foundation/Foundation.h>

@interface TSTimeInterval : NSObject
/** 相隔多少天 */
@property (nonatomic, assign) NSInteger day;
/** 相隔多少小时 */
@property (nonatomic, assign) NSInteger hour;
/** 相隔多少分钟 */
@property (nonatomic, assign) NSInteger minute;
/** 相隔多少秒 */
@property (nonatomic, assign) NSInteger second;
@end

extern NSString * const TSTimeIntervalDayKey;
extern NSString * const TSTimeIntervalHourKey;
extern NSString * const TSTimeIntervalMinuteKey;
extern NSString * const TSTimeIntervalSecondKey;

typedef enum {
    TSTimeIntervalIndexDay = 0,
    TSTimeIntervalIndexHour = 1,
    TSTimeIntervalIndexMinute = 2,
    TSTimeIntervalIndexSecond = 3
} TSTimeIntervalIndex;

@interface NSDate (Interval)
- (void)TS_timeIntervalSinceDate:(NSDate *)date day:(NSInteger *)day hour:(NSInteger *)hour minute:(NSInteger *)minute second:(NSInteger *)second;
/**
 * 返回值数组:0位置是day,1.....
 * 返回值数组:元素索引位置参考TSTimeIntervalIndex
 */
//- (NSArray *)TS_timeIntervalSinceDate:(NSDate *)date;

/**
 * 返回值字典:key参考TSTimeIntervalXXXKey
 */
//- (NSDictionary *)TS_timeIntervalSinceDate:(NSDate *)date;

- (TSTimeInterval *)TS_timeIntervalSinceDate:(NSDate *)date;

- (BOOL)TS_isYesterday;
- (BOOL)TS_isToday;
- (BOOL)TS_isTomorrow;
- (BOOL)TS_isThisYear;
@end
